from pyecharts import options as opts
from pyecharts.charts import Map

from pachong import all_wrold
from sql_select import sql_search

c = (
    Map()
    .add("部分国家", [list(z) for z in all_wrold()], "world")
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
    .set_global_opts(
        title_opts=opts.TitleOpts(title="Map-世界地图"),
        visualmap_opts=opts.VisualMapOpts(max_=100000),
    )
    .render("templates/map_world.html")
)

from pyecharts import options as opts
from pyecharts.charts import Map

def html_search(ss):
    m = Map()

    m.add("感染者", [list(z) for z in sql_search(ss)],ss)
    m.set_global_opts(
        title_opts=opts.TitleOpts(title="Map地图"), visualmap_opts=opts.VisualMapOpts(),
        toolbox_opts=opts.ToolboxOpts(is_show=True)
    )
    m.render("templates/map_c.html")

# html_search()